package HCI.src;

import java.io.IOException;
import java.net.ServerSocket;

public class Server{
public static void listenSocket(){
	  ServerSocket server = null;
	try{
	    server = new ServerSocket(2944);
	  } catch (IOException e) {
	    System.out.println("Could not listen on port 4444");
	    System.exit(-1);
	  }
	  while(true){
	    Runnable w;
	    try{
	//server.accept returns a client connection
	      w =  new ClientWorker(server.accept());
	      Thread t = new Thread(w);
	      t.start();
	    } catch (IOException e) {
	      System.out.println("Accept failed: 4444");
	      System.exit(-1);
	    }
	  }
	}
public static void main (String args [] ){
	listenSocket();
	
	
	
}


}